﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDD;
using Xunit;

using Vector3 = DDD.Vector3<float>;
using Vector4 = DDD.Vector4<float>;

namespace DokiDokiTest {
    public class TestPhongMaterial {
        [Fact]
        public void Test_New1 () {
            var mat = new PhongMaterial ();
            var amb = new Vector3(1,1,1);
            var dif = new Vector4 (1, 1, 1, 1);
            var spc = new Vector4 (1, 1, 1, 10);

            Assert.Equal (amb, mat.Ambient);
            Assert.Equal (dif, mat.Diffuse);
            Assert.Equal (spc, mat.Specular);
        }

        [Fact]
        public void Test_SetAmbient () {
            var mat = new PhongMaterial ();
            mat.SetAmbient (0.1f, 0.2f, 0.3f);

            var expected = new Vector3 (0.1f, 0.2f, 0.3f);
         
            Assert.Equal (expected, mat.Ambient);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// 順番はR,G,B,Aの順番で渡す｡
        /// </remarks>
        [Fact]
        public void Test_SetDiffuse () {
            var mat = new PhongMaterial ();
            mat.SetDiffuse (0.1f, 0.2f, 0.3f, 0.4f);  // (*1) 

            var expected = new Vector4 (0.1f, 0.2f, 0.3f, 0.4f);  // 

            Assert.Equal (expected, mat.Diffuse);
        }

        [Fact]
        public void Test_SetSpecular () {
            var mat = new PhongMaterial ();
            mat.SetSpecular (0.1f, 0.2f, 0.3f, 0.4f);

            var expected = new Vector4 (0.1f, 0.2f, 0.3f, 0.4f);

            Assert.Equal (expected, mat.Specular);
        }
    }
}
